package common.impl;

import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.HtmlEmail;

public class SendMail{
	private final String htmlHead="<html><body><div style='color:#336699;font-size:14pt'>";
    private final String htmlTail="</div></body></html>";
    public void send(String mailno,String msg) 
    	throws Exception {
    	HtmlEmail email = new HtmlEmail();
    	email.setHostName("pop3.163.com");
    	email.setSmtpPort(110);
    	email.setAuthenticator(new DefaultAuthenticator("lantao0", "9wer_wlabxxcloud_ifw"));
    	email.setTLS(true);
    	email.setFrom("lantao0@163.com");
    	email.setSubject("懒淘王");
    	email.setHtmlMsg(htmlHead + msg + htmlTail);
    	email.setCharset("UTF-8");
    	email.setMsg(msg);
    	email.addTo(mailno);
   		email.send();
    } 
}